package com.lz.job.log;

import com.lz.job.JobEnv;
import com.lz.job.resources.Constants;

import sos.spooler.Log;

/**
 * Job日志装饰.
 * <p>
 * 覆盖相关日志输出模式，加入工程名称.
 * <p>
 * <strong>日志用中文输出</strong>
 *
 * @author zhaoshb
 * @since 0.0.1
 */
public class LogDecorator {

	private Log orginLog = null;

	public LogDecorator(Log orginLog) {
		this.orginLog = orginLog;
	}

	public void info(String msg) {
		this.getOrginLog().info(this.constructLog(msg));
	}

	public void error(String msg) {
		this.getOrginLog().error(this.constructLog(msg));
	}

	private String constructLog(String msg) {
		return JobEnv.JobName + Constants.COLON + msg;
	}

	private Log getOrginLog() {
		return this.orginLog;
	}

}
